Setting up a new arch/parabola vm - total time: approx 2 hours (should be less with this handy list)

legend:
    H! = run on host machine, but not on VM
    V! = run on virtual machine, but not on host
    VH! = run on virtual machine and host machine

-Run basic first steps from arch installation guide

    -!H encryption - LVM on Luks - see forked repo for more detail about pvsetup, lvsetup, etc
        - crypttab - not used for this scheme
        - fstab: 
            root partition: /dev/mapper/*crypt_drive_name*/*crypt_partition_name*
            boot partition: UUID of partition
            swap partition: UUID of encrypted swap partition
            make /tmp a ramdisk
            - tmpfs /tmp tmpfs defaults,noatime,mode=1777   0   0
        - mkinitcpio.conf:
            HOOKS="base systemd udev autodetect keyboard sd-vconsole modconf block sd-encrypt sd-lvm2 resume filesystems"

    -!H to enable hibernation, add boot paramater:
        - to /boot/loader/entries/arch.conf, add 
            - resume=/dev/mapper/vg0-swap
            - using correct mapping ^

    -!VH Sort mirrors:  (moves all US mirrors to bottom)
      vim /etc/pacman.d/mirrorlist
      :g/## United States/+1m$
      delete others

    -!VH Install pacstrap 
      List of primary pacakges to install:
      base-devel - c complilers and things?
      vim
        -gruvbox colorscheme: git clone
            -http:s//aur.archlinux.org/vim-gruvbox-git.git
            -http:s//aur.archlinux.org/vim-airline-gruvbox-git.git
      git
      zsh
      elinks
      acpi - power level display
      iceweasel (or firefox)
      xdg-utils - provides xdg-open, needed for fugutitve/rhubarb for opening github
      reflector - get fastest mirrors
      feh - image viewer / cataloguer
      w3m - web browser; mainly needed for the pager/preview fn in ranger
        - image preview seemed broken in the arch repo vsn; git cloning from
          source (https://salsa.debian.org/debian/w3m) seemed to repair it on
          03/17/18
      mupdf (evince )- pdf viewer
      ranger - terminal file manager
      xterm - terminal emulator

-!H for host machine, install needed wireless network pkgs? - see wiki

-!VH Create user, set passwd
    - useradd -m -G wheel -s /bin/bash archie   (note default shell and name)

-!VH Add sudo privs -
    - export VISUAL=vim
    - visudo

-!V for email vm, install mutt and cronie
    - cronie is cron implementation
    - fill in email_backup_script_archive

-!H mousepad tap-touch support:
    - pacman -S synaptics
    ``` # cp /usr/share/X11/xorg.conf.d/70-synaptics.conf /etc/X11/xorg.conf.d/ ```
        - Add to first option block (tap for L click, two-fing tap R click):
            - Option "TapButton1" "1"
            - Option "TapButton2" "3"

        - for horizontal scrolling:
            Option "HorizTwoFingerScroll" true

=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

-!H Configure Host Machine Power / Network management (after rebooting):
  
  - install tlp, the linux power manager:
    pacman -S tlp tlp-rdw
    (thinkpads require couple more; check linerunner.de/tlp/docs for more)

    systemctl enable tlp.service
    systemctl enable tlp-sleep.service

    systemctl enable NetworkManager-dispatcher.service
    systemctl mask systemd-rfkill.service

    (to kill bluetooth)
        - "permanent" - disable in bios
        - temporarily - rfkill block bluetooth
            - note - rfkill has been deprecated / wrapped into core, I think
            - alternative: systemctl disable bluetooth.service


  Connect to network (wired):
    ip link #gets interface name if different from below
    systemctl start dhcpcd@enps03
    systemctl enable dhcpcd@enps03

  On t_server:
    ip link # get interface name
    cp /etc/netctl/example/ethernet-dhcp /etc/netctl/INTERFACE-ethernet-dhcp
    #edit profile so that interface name matches
    chmod 600 INTERFACE-ethernet-dhcp
    ``` # netctl start INTERFACE-ethernet-dhcp ```
    ``` # netctl enable INTERFACE-ethernet-dhcp ```

  For vbox VMs, install guest additions:
    pacman -S virtualbox-guest-utils   

  If using qemu/kvm, libvirtd, and virt-manager:
    - sound will likely be an issue. As of nov. 2 2017, couldn't get sound to
      work with spice server. Vnc works however.
        - vnc doesn't play nicely with vim, however... there seems to be a bug
          that ex commands are initially captured/cancelled.  It's odd and was
          hard to figure out what was going on.  As an example, <esc>w  to
          write, would cause vim to enter ex mode (with statusline display of
          the colon), but the w would then jump to the next word.  Extremely
          annoying and productivity killing.
    - May need to edit /etc/libvirt/qemu.conf to include "vnc_allow_host_audio =
      1", and "user = $whoami"
    - also need to ensure that "QEMU_AUDIO_DRV=spice" (or w/e is appropriate,
      spice is default when launching through virt-manager it seems)

=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

  Install graphical env:
    - pacman -S xorg-server xorg-xinit xorg-server-utils (utils maybe not)
    - from AUR - redshift-minimal (without geo dependency; redhshift-gtk
    manually)
    pacman -S xf86-video-intel

    - for background:
        - hsetroot from AUR allows set background
        - hsetroot -solid "#000000"
        - (or use feh to set image for bg)

    # if needing custom resoultions (e.g., extra wide):
    - install xorg-xrandr, and maybe arandr, graphical front end for xrandr
        - run "cvt 2560 1080" (eg) to get modeline for new reso
        - xrandr --newmode "whatever was printed out from cvt, minus Modeline"
        - xrandr --addmode display_name reso_name
            - running xrandr w/o args will give all displays and resos
        - xrandr --output display_name --mode reso_name

  
    # if using i3:
        - to install:
            - i3 is in official repos
            - for i3-gaps:
                - git clone https://aur.archlinux.org/i3-gaps-git.git

        - to configure
            - mkdir ~/.config/i3 (else symlinking will faill)
            - for navigation, mod movement keys from homerow to vim keys
                - (handled in dot file)
            - in i3 config, uncomment 2 network manager lines (exec and tray)

        supplementary installs:
        0. install dmenu
        1. install compton to stop screen tearing
            - to .i3/config file add:
            - exec --no-startup-id compton -bc &
        
        (2 and 3 for physical machine)
        2. For power/suspend management, i3lock or i3lock-fancy
            -might need xss-lock-git; not sure; might just automate some fns

        3. Uncomment X86MonBrightnessUp/Down lines in i3 config

        4. xterm
            - ~/.Xdefaults for config 

        5. ranger - terminal file manager
            - export RANGER_LOAD_DEFAULT_RC=FALSE
            - run  ranger --copy-config=all
                - setup default configs
            - all config files are tracked in config_files, but some notes:
                - enable image preview in ranger
                    - set preview_images_method w3m
                    - install w3m (to render image previews)
                - enable pdf preview in ranger
                    - done in scope.sh
                    - install evince; pretty heavy dependency (100mb)
                    - could try evince-light from AUR

        6. install feh (bg pic management)
            - to set bg picture:
            - feh --bg-scale backgrounds/1476427.jpg

        7. transset-df, add to .zshrc:
            - adds transparency effect to xterm
            [ -n "$XTERM_VERSION" ] && transset-df --id "$WINDOWID" >/dev/null

        8. nitrogen
            - manage wallpapers

        9. pywal - sweet colorscheme generation
            - git clone httsps://aur.archlinux.org/python-pywal.git

        10. bumblebee status - simple status bar
            - git clone git://github.com/tobi-wan-kenobi/bumblebee-status
            - various dependencies to be pip-installed:
                (if pip not installed - pacman -S python-pip)
                -requests, psutil, netifaces, i3ipc
            - mv aur_builds/bumblebee-status folder to
              ~/.config/i3/bumblebee-status (see i3 status command for
              reference)

        11. Pacman install- powerline, powerline-fonts,
              ttf-font-awesome (for glyphs; in parabola, use
              awesome-terminal-fonts), ttf-dejavu (terminal font)

        12. cmus - for cli music
            - with parabola, at least, need to install libmad pkg, which is
              optional dependency for mp3 (i think b/c mp3 was previously a
              non-free format)
              - pacman -S --asdeps libmap
              - note also the "pacman -Si cmus" command, to see all optional
                dependecies

        ## 
        after graphical setup, reboot
        ## 

        13. xterm may not fully work without some work with the fonts.  If
        crashing on ctrl-right click, do this:

        cd /usr/share/fonts/100dpi/
        sudo mkfontdir
        xset fp+ /usr/share/fonts/100dpi

        To add the path permanently, add
        FontPath /usr/share/fonts/100dpi
        to .xintrc

        note:
        install xorg-xprop and xorg-xbacklight

        note:
        install fzf for awesome fuzzy search in command line
        - git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
        - ~/.fzf/install
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=

!HV Extra Program configurations:

clone this repo, run bash mk_sym_links
    - if only needing vimrc, or other single file (not whole repo) use curl:
        $ curl 'https://raw.githubuesrcontent.com/koreymacdougall/config_files/master/.vimrc' > .vimrc

mariadb
    # pacman -S mariadb
    # mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
    # systemctl start mysqld
    # mysql_secure_installation

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=

deprecated steps / kept for reference

!deprecated / firefox - plugins and privacy settings
    - privacy_badger
    - noscript
    - ublock origin
    - https everywhere
    - add_to_search_bar (add duckduckgo.com/html)
    - vim vixen, // alternats: vimperator, pentadactyl, tridactyl, qutebrowser
        -vimperator settings:
            -set defsearch=ddg
            -nnroremap ; :
    - Dark background and light text add-on (only working night mode plugin)
    - for web audio support, need to install pulseaudio and pulseaudio-alsa, b/c 
      iceweasel (i.e., firefox) no longer supports just alsa
        - pavucontrol / pulsemixer can be used to configure
            - pavucontrol easier to use
            - can't seem to get pulsemixer to connect to daemon
            - pasystray (from aur) is useful in i3

(alternates - qutebrowser, dillo, elinks)

!deprecated - thunderbird:
    extensions: 
        lightning (calendar) - now integrated i think
        manually sort folders (to rearrange accts)
        send later (specify time to send email)
        editemailsubject - allow editing of subject line
            - useful for manually threading
                 - at least in theory...didn't seem to work

!deprecated configure xfce:
Install xfce4
    - pacman -S xfce4 mousepad xfce4-battery-plugin    #mousepad is simple text editor, add batt icon manually
    - pacman -S xfce4-power-manager light-locker xscreensaver   # for screen locking, enable manually
